#!/bin/bash

VIRT=$(systemd-detect-virt)

if [ "$VIRT" == "none" ]
then

apt -y install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager
apt -y install libguestfs-tools

sudo adduser $USER libvirt
sudo adduser $USER kvm
sudo adduser $USER libvirt-qemu

sudo adduser user libvirt
sudo adduser user kvm
sudo adduser user libvirt-qemu

mkdir -p /home/user/vm
sudo setfacl -R -m u:libvirt-qemu:rwx /home/user/vm

fi

